const express = require('express')
const router = express.Router()
const authController = require('../controllers/authController')
const { authMiddleware } = require('../middleware/auth')

// 公开接口 - 不需要认证
router.get('/captcha', authController.getCaptcha)
router.post('/register', authController.register)
router.post('/login', authController.login)

// 需要认证的接口
router.get('/user', authMiddleware, authController.getCurrentUser)
router.put('/password', authMiddleware, authController.changePassword)
router.post('/logout', authMiddleware, authController.logout)

module.exports = router 